Impact of the COVID-19 Pandemic on the Socioeconomic Inequalities in Mortality in Spanish Provinces

Background Although many studies have assessed the socioeconomic inequalities caused by COVID-19 in several health outcomes, there are numerous issues that have been poorly addressed. For instance, have socioeconomic inequalities in mortality from COVID-19 increased? What impact has the pandemic had on inequalities in specific causes of mortality other than COVID-19? Are the inequalities in COVID-19 mortality different from other causes? In this paper we have attempted to answer these questions for the case of Spain. Methods We used a mixed longitudinal ecological design in which we observed mortality from 2005 to 2020 in the 54 provinces into which Spain is divided. We considered mortality from all causes, not excluding, and excluding mortality from COVID-19; and cause-specific mortality. We were interested in analysing the trend of the outcome variables according to inequality, controlling for both observed and unobserved confounders. Results Our main finding was that the increased risk of dying in 2020 was greater in the Spanish provinces with greater inequality. In addition, we have found that: (i) the pandemic has exacerbated socioeconomic inequalities in mortality, (ii) COVID-19 has led to gender differences in the variations in risk of dying (higher in the case of women) and (iii) only in cardiovascular diseases and Alzheimer did the increased risk of dying differ between the most and least unequal provinces. The increase in the risk of dying was different by gender (greater in women) for cardiovascular diseases and cancer. Conclusion Our results can be used to help health authorities know where and in which population groups future pandemics will have the greatest impact and, therefore, be able to take appropriate measures to prevent such effects. Supplementary Information The online version contains supplementary material available at 10.1007/s44197-023-00125-0.


Background
Many studies have assessed socioeconomic inequalities in several health outcomes from COVID-19, concluding that low socioeconomic status, both at the individual and ecological level, is a risk factor for mortality and other health outcomes from COVID-19.
However, there are a number of issues that have barely been addressed or not addressed at all.First, have these inequalities continued to be the same, or have they decreased or increased?Second, focusing on mortality due to COVID-19, what has the impact of the pandemic been on inequalities in overall mortality and in specific causes mortality other than COVID-19?In relation to this, have the inequalities in COVID-19 mortality been greater than, less than, or equal to the inequalities in mortality from other causes?
We hypothesize that although socioeconomic inequalities in mortality from COVID-19 have existed, they may have varied over time and may not have coincided with the inequalities in mortality from other causes.
Therefore, in this paper we intend to assess the impact of the COVID-19 pandemic on inequalities in overall mortality and mortality from specific causes, as well as to find out if these inequalities have increased because of the pandemic.In addition, we intend to evaluate our objectives according to gender and at a geographical level smaller than a country level, specifically at the level of Spanish provinces.
To exemplify our hypotheses and objectives, we carried out a bibliographic search in PubMed in early July 2022 using the keywords 'inequalities', 'mortality' and 'COVID-19' and found 558 studies spanning from very early in the pandemic (April 2020) until (the end of June 2022.Among these studies, we found four systematic reviews [1][2][3][4] and two non-systematic reviews [5,6], which included studies at both the ecological and individual levels and of almost all research designs (both prospective and retrospective cohorts, case-control, cross-sectional and longitudinal studies), published between December 2019 and June 2022.At the beginning of the pandemic, publications such as those from the British Office for National Statistics (ONS), had already shown that the most economically deprived areas had higher COVID-19 mortality rates [7].In the same vein, the Nuffield Trust, again very early on in the pandemic, produced a graph showing that COVID mortality in the most deprived 10% of areas was double that in the least deprived 10% of areas [8].
While very few studies have addressed the impact of the pandemic on inequalities in overall mortality and in specific causes mortality other than COVID-19, most of them have, in fact, done it indirectly [9,11].The Nuffield trust graph showed that, as in the case of the rates of deaths involving COVID-19, the most deprived areas of England compared with the most affluent in deaths have twice the rate of deaths from suicide at all ages, of conditions such as liver disease and cancer for people aged under 75 (all corresponding to the period 2015-2017), as well as overall mortality rates in all ages (corresponding to 2018) [8].

Study Area and Study Period
We used a mixed longitudinal ecological design in which we observed mortality in the 54 provinces into which Spain is divided, from 2005 to 2020.
Data were obtained from death statistics according to cause of death from the Spanish National Institute of Statistics (INE) [31].
The INE follows Article 274 of the Regulations of the Spanish Civil Registry Law which states that, 'the doctor who has assisted the deceased in their last illness or any other who recognizes the corpse will immediately send to the Registry a death certificate in which, in addition to the name, surnames (…), will state that there are unequivocal signs of death, its cause and, with the precision required by the protocol, register the date, time and place of death'.In addition, as established in Article 20 of the aforementioned Regulations, the Civil Registrar Managers, through their Provincial Delegations, send the National Institute of Statistics the bulletins on births, marriages, deaths or other registrable events [32].
The units of measurement of the outcomes are the number of deaths between 2005 and 2020 in each of the Spanish provinces.

Socioeconomic and Demographic Variables
We considered socioeconomic and demographic variables as variables that could influence the evolution of the risk of dying.The socioeconomic variables were the average income per person (in Euros) and the Gini index (in percentage).Both were built as the average of the years 2015, 2016, 2017 and 2018 (Source: INE [33]).The demographic variable was the percentage of population aged 65 and over in 2020 (Source: INE [34]).In all cases, the unit of analysis was the province.
Average net income per person and the Gini index were categorized first into quartiles, and then these were grouped into first and second (reference category for the Gini index), and third and fourth (reference category for average net income per person).

Data Analysis
We were interested in analysing the trend of the outcome variables according to inequality.For this purpose, we specified generalized linear mixed models (GLMM) with variable response with two links from the Poisson family: negative binomial and zero inflated Poisson.Both allowed for the presence of heteroskedasticity in the response variable (i.e., non-constant variance across provinces and/or over time) and, in the latter case, an excess of zeros in mortality for some provinces and/or years for some causes of mortality (i.e., no deaths).
For each outcome variable we chose the link in which the Bayesian model selection method of Watanabe-Akaike information criterion (WAIC) [35] of the fitted model was lower.
In the GLMM, we assessed the trend in mortality (for all causes and for the specific causes indicated above) distinguishing between the most and least unequal provinces, approximating inequality with the Gini index.
As variables that could influence the risk, we included the average income per person of the provinces and we controlled for both observed and unobserved confounders.As observed confounders we considered the percentage of population aged 65 and over and the population of the province in each of the years under study.
In detail, conditional to the true risk in the province i on year t , the cases of the response variable ( Y it ) occurring in each of the provinces in each year was distributed as a negative binomial or as a zero inflated Poisson.
where it denoted E Y it = it ; i = 1, … , 54 ; t =2005, 2006,…, 2020; and Population it was the population at risk of being a case (death) in the province i and on year t.The link functions of the GLMMs were as follows: where the subindexes i and t indicated the province, and the year, respectively; income_Q12 i denoted whether the province is located in one of the first two quartiles of the average income per person; Gini_Q34 i denoted whether the province is located in one of the last two quartiles of the Gini index; Perc_pop_65_or_moreQ ik the percentage of population aged 65 and over in 2020 (in quartiles, taking the first quartile as the reference category): i , t denoted random effects; and s were the coefficients of the explanatory and control vari- ables ( e was the relative risk associated with each of them).
We included two random effects in the models.First, i , a random effect indexed on the province.This random effect was unstructured (independent and identically distributed random effects, iid), and captured individual heterogeneity, that is to say, unobserved confounders specific to the province and invariant in time.
Second, we included t , a structured random effect (random walk of order one, rw1) indexed on time.i.e., the evolution of the risk of dying over time.It should be noted that we allowed for this evolution to be non-linear.Following the integrated nested Laplace approximation (INLA) approach [36,37] when, as in our case, the random effects are indexed on a continuous variable, they can be used as smoothers to model non-linear dependency on covariates in the linear predictor.With this random effect we captured the temporal dependency, that is, the trend, which we allowed to be non-linear.
Note that we included in the models this random effect interacting with Gini_Q34.In fact, for each cause we were interested in evaluating the mortality trend (possibly nonlinear) distinguishing between the provinces located in the last two quartiles of the index of Gini (those with the greatest inequality) and in the first two quartiles (those with the least inequality) of the index.
Following the INLA approach, random effects were defined using a multivariate Gaussian distribution with a zero mean and precision matrix kΣ, where k was a constant and Σ was a matrix that defined the dependence structure of the random effects [36,37].In unstructured random effects (iid) Σ was a diagonal matrix of 1 s, and in random walk random effects Σ was defined assuming that increments (in rw1, Δu i = u t − u t−1 ) followed a Gaussian distri- bution with zero mean and a constant precision k [38,39].

Inference
Inferences were made following a Bayesian perspective, using the INLA approach [36,37] under its experimental mode [40].We used priors that penalize complexity (called PC priors).These priors are robust in the sense that they do not have an impact on the results and, in addition, they have an epidemiological interpretation [41].
All analyses were unstratified and stratified by gender.

Baseline Characteristics
In Table 1 we show the mortality rates from all causes for the year 2018, standardized by sex and age (per 100,000 inhabitants) without stratifying and stratifying by gender.Note that (from greater to lesser difference): Melilla (only one province), the provinces of Andalusia -Andalucía-, Ceuta (only one province); Murcia (only one province), the provinces of Extremadura; the provinces of the Canary Islands -Islas Canarias-; and the provinces of the Valencian Community -Comunidad Valenciana-; were the ones with standardized rates higher than those of Spain as a whole.
The rest (11 out of 17 autonomous communities) had lower standardized rates than in Spain.When stratified by gender, Cantabria, and Galicia (in men), and the Balearic Islands -Illes Balears-(in women) started to have higher standardized rates than Spain as a whole.Standardized mortality rates by cause of death (large groups), by autonomous communities and cities, and stratified by sex, are shown in Table S1 in supplementary material.
In Table 2 we show a descriptive of the average net income per person and the Gini index by Spanish provinces (average 2015 to 2018) and, in Fig. 1, their distribution on a map of Spain by provinces.In the 2015-2018 period, the five provinces with the highest average net income per person were, in descending order, Madrid; all the provinces of the Basque Country (Guipuzkoa, Bizcaia and Araba); and Barcelona (Catalonia); while the five provinces with the lowest average net income, from lowest to highest income, Almería; Huelva (both in Andalusia); Badajoz (in Extremadura); Jaén; and Cádiz (both in Andalusia) (Table 2).Note that, while in Madrid, the average net income per person was 31.42% higher than the average for all of Spain; in Almería it was 22.55% lower.Net income in Madrid was 70% higher than in Almería.Regarding the Gini index, also in the 2015-2018 period, the five provinces with the highest index were, in descending order, Melilla; Madrid; Malaga (Andalusia); Balearic Islands; and La Riona; while the five provinces with the lowest index, in this case in ascending order, Soria (Castilla y León); Badajoz (Extremadura); Huesca (Aragon); Jaen (Andalusia); and Palencia (Castilla y León).Note that, while in Madrid, the index was 13.1% higher than the average for all of Spain; in Soria it was 11.82% lower.The Gini index in Madrid was 29% higher than in Soria.
In Fig. 1 we can see that, while the distribution of the average net income per person presents a clear geographical pattern, with the first two quartiles to the north of an imaginary line that passes through Madrid in central Spain (with the exception of Galicia, in the west), the geographical distribution of the Gini index is not nearly so clear cut.For this reason, in Fig. S1 in the supplementary material, we represent a scatter graph of the Gini index against the average net income per person for the Spanish provinces.At the provincial level, a very slight downward trend can be seen, i.e., the higher the income, the lower the inequality.

Trends in All Causes of Death
In Figs.2a, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 and 15a we show the evolution of the (observed) crude mortality rate from all causes and from specific causes from 2005 to 2020.The results of the estimation of the GLMMs are shown in Tables 3, 4 As can be seen in Fig. 2a, the crude mortality rate decreased from 2005 to 2010, increasing afterwards, especially from 2012, before starting to fall again in 2019.This decrease was interrupted by the pandemic (Fig. 4a).
We estimated that during the study period (2005-2020) the risk of dying from all causes was 5.5% higher in provinces with lower socioeconomic levels (the first two quartiles of the average net income per person) (Table 3).This risk was higher for men (6.5%) than for women (4.5%, although this was different from zero only at 90% confidence).Note also how the pandemic (i.e., in 2020) did not change these estimates.The credible intervals of the relative risks for the variable average net income per person when COVID-19 was included overlap with the intervals when this cause of mortality was excluded (in all cases and in both men and women) (Table 3).Based on these results, we were able to affirm that the COVID-19 pandemic did not modify the gap in the risk of dying between the less economically disadvantaged provinces and the more affluent ones.
However, this picture changes when we inspect the estimators of the interaction between the temporal evolution of mortality and inequality, measured through the Gini index (Table 3 and Figs.2b and 3b).In those provinces with higher inequality (the last two quartiles of the Gini index), the risk of dying was 17.72% higher in 2020 than in 2019 (Relative risk considering 2019 as reference-RR from now on -: 1.772), while than in those with lower inequality (the first two quartiles), the risk was 14.70% higher (RR = 1.147) (Fig. 3b).Furthermore, these differences in risk between the provinces with the highest and lowest inequalities were statistically significant (the 95% credible intervals did not overlap, see the first row of Table 3 and Fig. 3b).Thus, although the COVID-19 pandemic increased the risk of dying in all Spanish provinces, the increase was more pronounced in those provinces with greater inequality.

Trends in All Causes of Death by Gender
These differences occurred in both sexes.The risk of dying in 2020 compared to 2019, was 16.33% higher in the case of men (RR = 1.163) and 18.01% higher in the case of women (RR = 1.180) in the provinces with greater inequality, while in the provinces with less inequality, it was 14.03% in the case of men (RR = 1.140) and 15.15% in the case of women (RR = 1.152) (Fig. 3b).However, the differences in the increases in risk (between 2019 and 2020) between the most and least unequal provinces were 2.30% for men (RR = 1.023) and 2.83% (RR = 1.028) for women; i.e., practically equal.Therefore, it does not seem that the COVID-19 pandemic has led to a difference in the increased risk of dying by gender.That said, things change when the indirect effects of the pandemic on mortality are considered (compare rows 1 and 2 of Table 3 and, in particular, Fig. 3b).In the case of women, the risk of dying (from causes other than COVID-19) changed its trend in 2020.Note, furthermore, that also in the case of women the increase in risk was greater in those provinces that were more unequal and that these increases were statistically different.

Trends in Specific Causes of Death
As regards the specific causes, throughout the period considered (2005-2020) the risk of dying from cardiovascular diseases (both sexes), respiratory diseases (in the case of men), digestive diseases (in the case of men), suicide (in the case of men), and diseases of the urinary system (in the case of women) was higher in provinces with lower socioeconomic levels.Note also that these risks were practically double (in suicides four times more) than the risk of dying from all causes.
The risk of dying from external causes in the case of women, however, was lower in the provinces with lower socioeconomic levels (approximately 12% lower -RR = 0.88-).In the rest of the causes, there were no differences in the risk of dying according to the socioeconomic level of the provinces throughout the entire period considered.
To facilitate the interpretation of the effects of COVID-19 on the risk of dying from other causes, we will distinguish between those that presented a decreasing evolution since well before 2020, those that presented an increasing evolution, and those that presented an oscillating (increasing and decreasing) evolution.
Among these causes, there was a change in trend (with an increased risk of dying in 2020) in cardiovascular diseases (both sexes) and in cancer (only in women) (Figs. 4  and 5).Only in the case of cardiovascular diseases was the risk of dying different between the most unequal provinces (higher risk in women) and the less unequal (higher risk in men) (Figs.4b and 5b).However, for both cardiovascular diseases and cancer there were differences by gender (greater increases in risk in 2020 in the case of women).
In the risk of dying from respiratory diseases and from infectious diseases (in both cases excluding COVID-19 and the influenza), as well as from the influenza, there was no change in trend, but the risk continued to decrease in 2020 (Figs. 6, 7 and 10).However, in the case of infectious diseases and influenza, the reduction in risk was greater in provinces with less inequality for both men and women (Fig. 7b and 10b).In contrast, in respiratory diseases, the reduction in risk was greater in provinces that were more unequal, albeit only for women (Fig. 6b).With the exception of infectious diseases (Fig. 10b), the differences (according to inequality in the provinces) in the variations in the risk of dying between 2019 and 2020 were greater in women (Figs.6b and 7b).
Alzheimer's (Fig. 8a), digestive system diseases (Fig. 9a), mental and behavioural disorders (Fig. 11a), diabetes (Fig. 12a), external causes (Fig. 13a) and the rest of the causes (Fig. 15a) presented an increasing evolution since before 2020.Among these causes, changes in trend (from an increase before 2020 to a reduction in 2020) were estimated in the risks of dying from digestive system diseases (Fig. 10), mental and behavioural disorders (Fig. 11), and external causes (Fig. 13).
In the risk of dying from digestive system diseases, there were no differences due to inequality in the provinces or by gender (Fig. 9b).However, the reduction in the risk of dying from mental and behavioural disorders (Fig. 11b) and from external causes (Fig. 13b) was different according to the inequality in the provinces (greater risk reduction in the less unequal provinces) and in gender (only in women).Even in 2020, while the risk from external causes increased in the most unequal provinces, it decreased in the least unequal provinces (Fig. 13b).
Neither in the risk of dying from diabetes (Fig. 12b), nor for the rest of the causes (Fig. 15b) were any differences found due to inequality by provinces and by gender.In the risk of dying from Alzheimer's (Fig. 8b), as in diabetes and other causes, while there was no change in the trend in the increased risk of dying in 2020, there were differences depending on the inequality of the provinces (greater increases in risk in less unequal provinces), although not by gender.
Mortality due to suicides (Fig. 14a) presented an oscillating evolution.In this case, there was an increase in the risk of dying in 2020, although this was not found to be different Fig. 8 Evolution of mortality from Alzheimer's Fig. 9 Evolution of mortality from digestive system diseases according to inequality by province (greater, although not statistically significant, in provinces with less inequality) or according to gender (Fig. 14b).
Finally, we found that the variations in the risk of dying between 2019 and 2020 according to inequality were greater in the case of COVID-19 than in the other causes.In this sense, while the difference in risk between the most unequal and the least unequal provinces was 3.09 percentage points in mortality from all causes (Relative risk, taking the least unequal provinces as reference: 1.039) (2.36 in the case of men-Relative risk: 1.0236-and 2.96 in the case of women-Relative risk: 1.0296-; Relative risk between sexes, taking men as the reference category: 1.006), mortality excluding COVID-19 decreased 0.18 percentage points (Relative risk: 1.0018) (increasing 0.15 in men-Relative risk: 1.0015-and decreasing 0.52 in women-Relative risk: 0.948; Relative risk between sexes, taking men as the reference category: 0.947).Among the specific causes, we would like to highlight an increase in the differences between the most and the least unequal provinces in external (excluding suicide) causes (2.37 points, 0.06 in men and 5.91 in women), diseases of the urinary system (2.03 points-Relative risk: 1.023-, 1.58 in men-Relative risk: 1.0158-and 2.22 in women-Relative risk: 1.022; Relative risk between sexes, taking men as the reference category: 1.006), the rest of causes (1.66 points-Relative risk: 1.0166-, 1.25 men -Relative risk: 1.0125-and 1.65 womenRelative risk: 1.0165-; Relative risk between sexes, taking men as the reference category: 1.004) and in cardiovascular only in women (0.67 points-Relative risk: 1.0067-).On the contrary, in suicides (2.00 points Relative risk: 1.020-, 1.38 men-Relative risk: 1.0138-and 2.88 women-Relative risk: 1.0288-; Relative risk between sexes, taking men as the reference category: 1.015), Alzheimer (1.67 points-Relative risk: 1.0167-, 1.41 men-Relative risk: 1.0141-and 1.42 women -Relative risk: 1.0142; Relative risk between sexes, taking men as the reference category: 1.000) and cardiovascular, only men (1.23 points-Relative risk: 1-0123-), the increase in risk was greater in the less unequal provinces.Note that, with the exception of Alzheimer's, the variations in risk were greater in women.In the other causes, either there was no difference in risk between 2019 and 2020 (diabetes) or that risk was reduced.

Discussion
Our main finding was that the increased risk of dying in 2020 because of the COVID-19 pandemic was greater in the Spanish provinces with greater inequality, at least when assessed by the Gini index.Note that, we found that inequality, measured by the Gini index, and not so much income level, was the variable that best reflected the impact COVID-19 had on the risk of dying.In line with our results, de Souza et al. point out that the social inequality of municipalities in the state of São Paulo (Brazil) and measured by the Gini index, was the variable with the greatest weight (together with density) in explaining the COVID-19 mortality [24].Eichenbaum and Tate, using the Index of Concentration at the Extremes, a metric which captures socio-spatial and economic polarization, found that the counties of Georgia, USA, with the largest income disparity had 1.7 times the case-mortality rate compared to the most privileged counties [22].
Here, we have also provided evidence to answer the questions raised earlier.
First, the pandemic has exacerbated socioeconomic inequalities in mortality.Although it is true that at the end of the first semester of the pandemic Marmot and Allen suggested that COVID-19 would amplify inequalities [43], very few studies have confirmed this.Among them, we will mention Simon et al., who found that the long-standing mortality advantage in the Latino population relative to the White population in Los Angeles County was reversed in 2020 [9], and Kontopantelis et al. who pointed out that inequalities between socioeconomic and geographic groups resulting from the COVID-19 pandemic are more pronounced than previously reported [11].In fact, these inequalities in the outcomes of COVID-19 increased as the pandemic progressed.Thus, Bacigalupe et al. show that, in Spain, studies based on socioeconomic data of the census revealed an increase in inequalities, especially in women, between the first and second waves (July-December 2020) [5].Griffith et al. point out that, contrary to previous months, the strong spatial patterning during autumn 2020 in England and Wales was almost entirely explained by deprivation.Furthermore, as mortality declines it does not do so equally, evolving more slowly in more deprived areas [26].
Second, although not directly, COVID-19 led to gender differences in the variations in the risk of dying between 2019 and 2020; higher in the case of women.In this sense, the risk of dying from causes other than COVID-19 changed its trend in 2020 only in the case of women.Furthermore, this increase in risk was greater in those provinces that were more unequal.Thus, the pandemic, in terms of its indirect effects, would have amplified gender inequalities in mortality.In fact, in a non-systematic review of data, Flor et al. find that there have been intensified levels of pre-existing non health-related inequalities between women and men during the COVID-19 pandemic [44].Our findings are in line with those found in other studies [2,5,45], especially at the ecological level, because at the individual level either no differences were found by gender in the social gradient of the effects of COVID-19 on mortality [46] or when found, were higher in men than in women [17,20].Third, as regards the specific causes of mortality, there was a change in trend, from a decreasing or from an oscillating evolution since before 2020, to a growth in 2020 in mortality from cardiovascular diseases, suicide, and cancer, albeit the latter only in women.Among the causes that were already growing before 2020, diabetes (both sexes) and Alzheimer's (only in women) grew at a faster rate.However, only in cardiovascular diseases and Alzheimer's did the increased risk of dying differ between the most and the least unequal provinces.The increase in the risk of dying was different by gender (greater in women) in cardiovascular diseases and in cancer.
Our results are partly consistent with other studies.Konstantinoudis et al. find an effect of the pandemic on mortality due to myocardial infarction [18].Simon et al. found that Latino individuals experienced an increase in heart disease annual age-adjusted mortality rates from 2019 to 2020 (although also in diabetes) that was not observed among White individuals [9].The excess in years of life lost to cardiovascular diseases (and also diabetes) in the year 2020 was also found by Kontopantelis et al. [11].However, they too do not find significant pandemicrelated changes in year of list lost due to cancer and other indirect deaths (including drug-related, alcohol-specific, suicides, fatal accidents, and all other causes) [11].Unlike us, Orellana and de Souza, find that despite the overall decrease in suicides in Brazil over the period assessed, substantial excess suicides were observed in regions that are historically more prone to health and socioeconomic inequalities [47].Last, we found that the variations in the risk of dying from all causes between 2019 and 2020 according to inequality were greater than the risk of dying when COVID-19 is excluded.We also estimate differences in the increases in the risk of dying from specific causes according to the inequality of the provinces, albeit lower than in the case of COVID-19.These differences were greater in the provinces with more inequality in some of the causes (external causes-excluding suicides -, diseases of the urinary system, the rest of causes and in cardiovascular, in this case only women) and minor in others (suicide, Alzheimer's and cardiovascular, only in men).However, except for the risk of dying from Alzheimer's, we found that variations were consistently greater for women.Our results differ in part from those provided by the Nuffield Trust [8], according to whom the rates of death in the most deprived areas are twice those of the most affluent for both COVID-19 and other causes.However, it must be said that these results refer to England and the first wave, so they could not be completely generalized.In addition, the results were not adjusted for possible confounders.
Our study may have some limitations.The most important being that we used an ecological design, thus leading to the possibility of an ecological fallacy.Therefore, it should be noted that, when interpreting the results, no inferences should be made at the individual level.It should also be noted, however, that several cohort studies [28][29][30] point out that there were inequalities in the outcomes of COVID-19, mortality in particular, both at the individual and the community contextual levels.Furthermore, ecological designs imply the existence of unmeasured confounding bias.That said, we have attempted to control for this bias in terms of both observed and unobserved confounding.Futhermore, in using data at the provincial level, we could have incurred the 'modifiable areal unit problem' (MAUP) [48].The MAUP, which refers to data aggregation in units for analysis, is a potential source of bias that affects spatial studies using aggregated data.Unfortunately, this problem is unsolvable since data are not available in Spain at a more disaggregated geographical level.
There could have been measurement errors in both the response variables and the explanatory variables.Regarding mortality from COVID-19, the COVID-19 Excess Mortality Collaborators estimated that, in the case of Spain, the ratio between excess mortality rate and reported COVID-19 mortality rate was 1.64 (1.59-1.68)[10].The differences could be attributed to changes in the criteria for defining a death from COVID-19 [48], to underdiagnosis due to insufficient testing, or to other pandemic-related effects related to a reduction in access to health care [10].Thus, for example, until May 21, 2020 the Spanish Government considered a death by COVID-19 to be someone who had presented a positive PCR result and thereafter is both the one who had a positive result on some test (PCR or fast test) and the one who presented symptoms at some point and a sanitary professional classified them as a possible case, but they did not have a diagnostic test with a positive result [49].
As regards the explanatory variables, the INE estimates both the average income per person and the Gini index from the information provided in the income tax returns [32].However, in Spain people who have earned less than €22,000 per annum are not required to file a tax return.Thus, the INE does not have information on the most economically disadvantaged people.Nevertheless, given that the presence of measurement errors tends to underestimate the effect of the variable measured with error [50], it is very likely that our findings are indicative of greater inequality and its effects on the risks of dying.
Finally, in some of the cases there were no deaths in some of the provinces.This could imply that the appropriate link for GLMMs is not a Poisson one, even though it is a counting variable.For this reason, we allowed the GLMM link to be bien negative binomial bien zero inflated Poisson.Furthermore, this excess of zeros in the outcome variable could have implied a reduction in statistical power.Since the sample size cannot be increased, we were able to increase the power, increasing the risk (i.e., probability of making a type I error), say from 5 to 10% for example, thus reducing the probability of making a type II error and therefore increased statistical power.

Conclusion
As main conclusions we would point out: (i) the increased risk of dying in 2020 because of the COVID-19 pandemic was greater in the Spanish provinces with greater inequality; (ii) the pandemic has exacerbated socioeconomic inequalities in mortality and; (iii) although not directly, COVID-19 led to gender differences in the variations in the risk of dying between 2019 and 2020; higher in the case of women.
We believe that our results can be used by health authorities to know where and in which population groups future pandemics will have the greatest impact and, therefore, be able to take the appropriate measures to prevent their effects.

Fig. 1
Fig. 1 Distribution of the average net income per person and the Gini index in the Spanish provinces in 2019.Average net income quartiles (a) and Gini index quartiles (b)

Fig. 4 Fig. 5
Fig. 4 Evolution of mortality from cardiovascular diseases

Fig. 11
Fig. 11 Evolution of mortality from mental and behavioural disorders, suicides not included

Table 1
Mortality rates from all causes, standardized by sex and age (per 100,000 inhabitants) Spain, autonomous communities and cities.Without stratifying and stratifying by gender, 2018

Table 2
Descriptive of the average net income per person and the Gini index

Table 3
Results of the estimation of the models Relative risks (95% credible intervals) Reference categories in brackets.Q3 and Q4 for average net income per person and 2005-2017 for the trend.Models adjusted by Gini index, percentage of population aged 65 or over, individual heterogeneity (at province level), time trend and population (as offset)

Table 4
Results of the estimation of the models.Relative risks (95% credible intervals)Reference categories in brackets.Q3 and Q4 for average net income per person and 2005-2017 for the trend.Models adjusted by Gini index, percentage of population aged 65 or over, individual heterogeneity (at province level), time trend and population (as offset)

Table 5
Results of the estimation of the models.Relative risks (95% credible intervals)Reference categories in brackets.Q3 and Q4 for average net income per person and 2005-2017 for the trend.Models adjusted by Gini index, percentage of population aged 65 or over, individual heterogeneity (at province level), time trend and population (as offset)

Table 6
Results of the estimation of the models.Relative risks (95% credible intervals) Reference categories in brackets.Q3 and Q4 for average net income per person and 2005-2017 for the trend.Models adjusted by Gini index, percentage of population aged 65 or over, individual heterogeneity (at province level), time trend and population (as offset)

Table 7
Results of the estimation of the models.Relative risks (95% credible intervals)Reference categories in brackets.Q3 and Q4 for average net income per person and 2005-2017 for the trend.Models adjusted by Gini index, percentage of population aged 65 or over, individual heterogeneity (at province level), time trend and population (as offset)